<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://47.106.66.89:8080/js/vue.min.js"></script>
    <script src="http://47.106.66.89:8080/js/axios.min.js"></script>
    <link href="http://47.106.66.89:8080/js/ele-2.15.7/theme-chalk/index.css" rel="stylesheet">
    <script src="http://47.106.66.89:8080/js/ele-2.15.7/index.js"></script>
    <link href="http://cdn.bootcss.com/highlight.js/8.0/styles/monokai_sublime.min.css" rel="stylesheet">
    <script src="js/myhead.js"></script>
    <link rel="stylesheet" href="css/userinfo.css">
</head>
<body >
<div id="app" >
    <myhead @uo="getUserinfo">
    </myhead>
<!--

-->
    <div class="useinfo_box" v-bind:style="{ backgroundImage: 'url(' + backgroundImage + ')'}">
        <div class="userinfo_head" >
            <img :src="userinfo.photo">
        </div>
        <div class="userinfo_info">
            <div class="userinfo_name">用户名：{{userinfo.uname}}

                <el-upload
                        action="other/common/uploads"
                        :on-success="Success"
                        :show-file-list="false"
                        >
                    <el-button style="margin-left: 100px;position:absolute; top:150px;left: 1400px; border: none" slot="trigger" size="small" type="primary">选择文件</el-button>
                </el-upload>

            </div>
            <div class="userinfo_phone">手机号码：{{userinfo.phone}}</div>
            <div class="userinfo_email">Email：{{userinfo.email}}</div>
            <div class="userinfo_desc">个人简介：{{userinfo.descript==null?'还没有简介':userinfo.descript}}</div>
            <div class="userinfo_guan">
                <div class="fans">粉丝：{{fansPage.total}}</div>
                <div class="attention">关注：{{attenPage.total}}</div>
                <div class="admire">获赞：{{guan.admire}}</div>
                <div class="admire">余额：{{userinfo.balance}}</div>
            </div>
        </div>
    </div>

    <el-tabs :tab-position="tabPosition" style="height: 660px; width: 70%;margin: 30px auto">
        <el-tab-pane label="我的blog" style="height: 650px; background-color: #ffffff">
            <div class="myBlog">
                <div class="myBlog_div" v-for="item in article">
                    <img :src="item.pic">
                    <div class="myBlog_title">{{item.title.length>10?item.title.substring(0,12)+'...':item.title}}</div>
                    <div class="myBlog_time" style="color: gray;font-size: 12px;">
                        <span><i class="el-icon-timer"></i>&nbsp;{{item.adate}}</span>
                        <span><i class="el-icon-view">&nbsp;</i>{{item.view}}</span>
                        <span><i class="el-icon-star-on">&nbsp;</i>{{item.likes}}</span>
                    </div>
                    <div class="myBlog_button">
                        <el-button @click="bian(item)" type="primary" plain style="height: 30px;line-height: 0px;margin-top: 5px;margin-left: 50px">编辑</el-button>
                        <el-popconfirm
                                title="这是一段内容确定删除吗？"
                                @confirm="quding(item.aid,0)"
                        >
                            <el-button slot="reference" style="height: 30px;line-height: 0px;margin-top: 5px;">删除</el-button>
                        </el-popconfirm>
                    </div>
                </div>
                <div class="fenye">
                    <el-pagination style="margin: 10px 480px"
                            layout="prev, pager, next"
                            :page-size="page.size"
                            :total="Number(page.total)"
                            @current-change="changePage">
                    </el-pagination>
                </div>

            </div>
        </el-tab-pane>
        <el-tab-pane label="我的收藏" style="height: 650px;width: 100%; background-color: #ffffff">
            <div style="width: 100%;height: 560px;box-sizing: border-box">
                <div v-for="item in myFav" style=" float:left; width: 250px;height: 262px; margin-left: 100px;margin-bottom: 10px;margin-top: 10px;cursor: pointer;border: 1px solid grey;">
                    <img style="width: 100%;height: 65%;object-fit: revert;" :src="item.article.pic">
                    <div class="myBlog_title">{{item.article.title.length>10?item.article.title.substring(0,12)+'...':item.article.title}}</div>
                    <div class="myBlog_time" style="color: gray;font-size: 12px;">
                        <span><i class="el-icon-timer"></i>&nbsp;{{item.article.adate}}</span>
                        <span><i class="el-icon-view">&nbsp;</i>{{item.article.view}}</span>
                        <span><i class="el-icon-star-on">&nbsp;</i>{{item.article.likes}}</span>
                    </div>
                    <div class="myBlog_button" >
                        <el-popconfirm
                                title="这是一段内容确定删除吗？"
                                @confirm="delCollection(item.usid,item.aid)"
                        >
                            <el-button slot="reference" style="height: 30px;line-height: 0px;margin-top: 5px;margin-left: 145px">取消收藏</el-button>
                        </el-popconfirm>
                    </div>
                </div>

            </div>
            <div style="width: 100%;height: 90px;box-sizing: border-box">
                <el-pagination style="margin: 10px 480px"
                               layout="prev, pager, next"
                               :page-size="favPage.size"
                               :total="Number(favPage.total)"
                               @current-change="myFavChange">
                </el-pagination>
            </div>
        </el-tab-pane>
        <el-tab-pane label="私密博客" style="height: 650px;width: 100%; background-color: #ffffff">
            <div class="myBlog">
                <div class="myBlog_div" v-for="item in privateBlog">
                    <img :src="item.pic">
                    <div class="myBlog_title">{{item.title.length>10?item.title.substring(0,12)+'...':item.title}}</div>
                    <div class="myBlog_time" style="color: gray;font-size: 12px;">
                        <span><i class="el-icon-timer"></i>&nbsp;{{item.adate}}</span>
                        <span><i class="el-icon-view">&nbsp;</i>{{item.view}}</span>
                        <span><i class="el-icon-star-on">&nbsp;</i>{{item.likes}}</span>
                    </div>
                    <div class="myBlog_button">
                        <el-button @click="bian(item)" type="primary" plain style="height: 30px;line-height: 0px;margin-top: 5px;margin-left: 50px">编辑</el-button>
                        <el-popconfirm
                                title="这是一段内容确定删除吗？"
                                @confirm="quding(item.aid,4)"
                        >
                            <el-button slot="reference" style="height: 30px;line-height: 0px;margin-top: 5px;">删除</el-button>
                        </el-popconfirm>
                    </div>
                </div>
                <div class="fenye">
                    <el-pagination style="margin: 10px 580px"
                                   layout="prev, pager, next"
                                   :page-size="page.size"
                                   :total="Number(privatePage.total)"
                                   @current-change="changePage">
                    </el-pagination>
                </div>

            </div>
        </el-tab-pane>
        <el-tab-pane label="未通过" v-if="weiBlog.length>0" style="height: 650px;width: 100%; background-color: #ffffff">
            <div class="myBlog">
                <div class="myBlog_div" v-for="item in weiBlog">
                    <img :src="item.article.pic">
<!--                    <div class="myBlog_title">{{item.article.title.length>10?item.title.substring(0,12)+'...':item.article.title}}</div>-->
                    <div class="myBlog_time" style="color: gray;font-size: 12px;">
                        <span><i class="el-icon-timer"></i>&nbsp;{{item.article.adate}}</span>
                        <span><i class="el-icon-view">&nbsp;</i>{{item.article.view}}</span>
                        <span><i class="el-icon-star-on">&nbsp;</i>{{item.article.likes}}</span>
                    </div>
                    <div class="myBlog_button">

                        <el-popover
                                placement="top-start"
                                title="原因"
                                width="200"
                                trigger="hover"
                               >
                            <span style="font-weight: bold;font-size: 18px">由于该博客存在<span style="color: red;">{{item.content }}</span>等不良信息</span>
                            <el-button slot="reference" type="primary" plain style="height: 30px;line-height: 0px;margin-top: 5px;margin-left: 50px">查看原因</el-button>
                        </el-popover>
                        <el-button @click="shenS(item.fid)" slot="reference" style="height: 30px;line-height: 0px;margin-top: 5px;">申诉</el-button>

                    </div>
                </div>
                <div class="fenye">
                    <el-pagination style="margin: 10px 580px"
                                   layout="prev, pager, next"
                                   :page-size="page.size"
                                   :total="Number(privatePage.total)"
                                   @current-change="changePage">
                    </el-pagination>
                </div>

            </div>
        </el-tab-pane>
        <el-tab-pane label="我的粉丝" style="height: 650px; background-color: #ffffff">
            <div style="width: 100%;height: 560px;box-sizing: border-box;overflow: hidden">
                <div v-for="item in myFans" style="width: 80%;height: 14%;border: 1px solid grey;margin: 10px auto">
                    <div style="float: left;margin-left: 100px; width: 100px;height: 100%;">
                        <img :src="item.userinfo.photo" style="width: 95%;height: 100%; object-fit: revert;border-radius: 50%">
                    </div>
                    <div style="float: left;margin-left: 20px;width: 100px;height: 100%;">
                        <h2 style="padding-top: 10px">{{item.userinfo.uname}}</h2>
                        <p style="padding-top: 10px">{{item.userinfo.descript==null||item.userinfo.descript==''?'还没有简介':item.userinfo.descript}}</p>
                    </div>
                    <div style="float: right;margin-right: 100px;: 100px;width: 100px;height: 100%;">
                        <el-button v-if="item.flag" disabled   style="margin-top: 20px" type="primary" round>已关注</el-button>
                        <el-button v-else   @click="attention(item.userinfo.usid)" style="margin-top: 20px" type="primary" round>回&ensp;&ensp;关</el-button>
                    </div>
                </div>
            </div>
            <div >
                <el-pagination style="margin: 30px 480px"
                               layout="prev, pager, next"
                               :page-size="fansPage.size"
                               :total="Number(fansPage.total)"
                               @current-change="changePage">
                </el-pagination>
            </div>
        </el-tab-pane>
        <el-tab-pane label="我的关注" style="height: 650px;width: 100%; background-color: #ffffff">
            <div style="width: 100%;height: 560px;box-sizing: border-box;overflow: hidden">
                <div v-for="item in myAttention" style="width: 80%;height: 14%;border: 1px solid grey;margin: 10px auto">
                    <div style="float: left;margin-left: 100px; width: 100px;height: 100%;">
                        <img :src="item.userinfo.photo" style="width: 95%;height: 100%; object-fit: revert;border-radius: 50%">
                    </div>
                    <div style="float: left;margin-left: 20px;width: 100px;height: 100%;">
                        <h2 style="padding-top: 10px">{{item.userinfo.uname}}</h2>
                        <p style="padding-top: 10px">{{item.userinfo.descript==null||item.userinfo.descript==''?'还没有简介':item.userinfo.descript}}</p>
                    </div>
                    <div style="float: right;margin-right: 100px;: 100px;width: 100px;height: 100%;">
                        <el-button disabled   style="margin-top: 20px" type="primary" round>已关注</el-button>
                    </div>
                </div>
            </div>
            <div >
                <el-pagination style="margin: 30px 480px"
                               layout="prev, pager, next"
                               :page-size="fansPage.size"
                               :total="Number(attenPage.total)"
                               @current-change="changePage">
                </el-pagination>
            </div>
        </el-tab-pane>
    </el-tabs>
    <div class="footer">
        <div class="er"></div>
        <div class="newBlog">
            <p style="margin-top: 60px;font-size: 18px;font-weight: bold">最近博客</p>
            <p style="margin-top: 10px">用户故事(User Strory)</p>
            <p style="margin-top: 10px"> 关于刻意联系的清单</p>
            <p style="margin-top: 10px">失败要趁早</p>
        </div>
        <div class="lian">
            <p style="margin-top: 60px;font-size: 18px;font-weight: bold">联系我们</p>
            <p style="margin-top: 10px">Email：2435939131@qq.com</p>
            <p style="margin-top: 10px">QQ：2435939131</p>
        </div>
        <div class="lie">
            <p style="margin-top: 60px;font-size: 18px;font-weight: bold">Lirenmi</p>
            <p style="margin-top: 10px">这是我的个人博客、会分享关于编程、写作、思考相关的任何</p>
            <p style="margin-top: 10px">内容，希望可以给来到这儿的人有所帮助...</p>
        </div>
    </div>

    <!--弹框-->
    <el-dialog
            title="提示"
            :visible.sync="Visible"
            @close="closgDilog"
            width="60%"
            center>
       <div>
           标题：<el-input  placeholder="请输入内容" v-model="tempArtInfo.title"></el-input>
       </div>
       分类：<br/>
        <el-select  placeholder="请选择"  v-model="tempArtInfo.tid">
        <el-option
                v-for="item in type"
                :key="item.tid"
                :value="item.tname"
        >
        </el-option>
    </el-select><br>
        图片：<br>
        <el-upload
                action="other/common/upload"
                :on-success="handleSuccess"
                :on-error="handleError">
            <el-button style="border: none" slot="trigger" size="small" type="primary">选择文件</el-button>
        </el-upload><br>
        <img style="width: 200px;height: 200px" :src="tempArtInfo.pic">
        <div id="edit">
        </div>
        <el-checkbox-group v-model="checkList" style="margin-left: 100px">
            <el-checkbox label="私密"></el-checkbox>
            <el-checkbox label="赞赏"></el-checkbox>
            <el-checkbox label="评论"></el-checkbox>
        </el-checkbox-group>
        <span slot="footer" class="dialog-footer">
    <el-button @click="abolish">取 消</el-button>
    <el-button type="primary" @click="save">确 定</el-button>
  </span>
    </el-dialog>

<!--    申诉弹框-->
    <el-dialog
            title="提示"
            :visible.sync="shenDialogVisible"
            width="30%"
            center>
        <span style="font-size: 18px" v-model="shen.content">请输入你的申诉的理由:</span>

        <el-input style="margin-top: 10px"
                type="textarea"
                :rows="2"
                placeholder="请输入内容"
                v-model="shen.content">
        </el-input>
        <span slot="footer" class="dialog-footer">
    <el-button @click="shenDialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="sendShen">确 定</el-button>
  </span>
    </el-dialog>

<!--
    已经申诉弹框
-->
    <el-dialog
            title="提示"
            :visible.sync="yiVisible"
            width="30%"
            :before-close="handleClose">
        <span style="font-size: 18px">{{showJie}}</span>
        <span slot="footer" class="dialog-footer">
  </span>
    </el-dialog>
</div>
<script src="https://cdn.jsdelivr.net/npm/wangeditor@latest/dist/wangEditor.min.js"></script>
<script src="http://cdn.bootcss.com/highlight.js/8.0/highlight.min.js"></script>
<script>
    let app=new Vue({
        el:"#app",
        data:{
            yiVisible:false,
            shenDialogVisible:false,
            editor:null,
            Visible:false,
            centerDialogVisible: false,
            tabPosition: 'left',
            userinfo:'',
            guan:{fans:'',attention:'',admire:''},
            error:{uname:'',pwd:'',repassword:'',email:'',phone:''},
            fileList: {name:'',url:'',},
            article:"",
            page:{page:1,size:6,total:0},
            type:'',
            tempArtInfo:'',
            myFav:'',  //我的收藏
            favPage:{page:1,size:6,total:0},  //我的收藏分页
            fansPage:{page:1,size:6,total:0},  //我的粉丝分页
            myFans:'',   //我的粉丝
            myAttention:'',    //我关注的博主
            attenPage:{page:1,size:6,total:0},   //我的关注的分页
            privateBlog:"",                      //私密blog
            privatePage:{page:1,size:6,total:0} ,  //私密的分页
            checkList:[],
            draftArt:'',                 //存稿
            draftPage:{page:1,size:6,total:0},     //存稿的分页
            backgroundImage: 'image/aa4e8113-bce1-4a8f-a5d7-3b6cf65641e1.duitang.com_uploads_item_202004_30_20200430220703_L3Hsa.jpeg&refer=http___c-ssl.duitang.jpg',
            weiBlog:"",       //未通过的blog
            weiBlogPage:{page:1,size:6,total:0},    //未通过的分页
            ws:null,
            shen:{content:'',usid:'1',status:1,fid:'',flag:"false"},
            AllShen:'',
            showJie:"",
            imageUrl: '',
            picUrl:'',
        },
        methods:{
            Success(response){
                this.picUrl=(response.data);
                this.backgroundImage=this.picUrl;
                axios.get(`user/userinfo/success?url=${this.picUrl}&usid=${this.userinfo.usid}`).then(res=>{

                })
            },
            handleClose(done) {
                this.$confirm('确认关闭？')
                    .then(_ => {
                        done();
                    })
                    .catch(_ => {});
            },
            //申诉的确定按钮
            sendShen(){
                if(this.shen.content==""){
                    this.$message.error("申诉的原因不能为空");
                    return;
                }
                this.insertShen();
                this.ws.send(JSON.stringify(this.shen));
                this.shenDialogVisible=false;
            },
            //申诉
            shenS(fid){
                this.shen.content="";
                let flag=false;
                let sh="";
                for (let i = 0; i < this.AllShen.length; i++) {
                    if(this.AllShen[i].fid==fid){
                       flag=true;
                       sh=this.AllShen[i];
                    }
                }

                if(flag==true){
                    if(sh.status==2){
                        this.showJie="你的申诉已经通过了";
                    }else if(sh.status==1){
                        this.showJie="该博客已经申诉过了，正在处理中..."
                    }else if(sh.status==-1){
                        this.showJie="你的申诉没有通过"
                    }
                    this.yiVisible=true;

                }else{
                    this.shen.fid=fid;
                    this.shenDialogVisible=true;

                }
                this.Connection();

            },
            insertShen(){
                axios.post("../../other/shen/insertShen",this.shen).then(res=>{
                    console.log(res.data);
                })
            },
            //查询出所有的申诉
            getAllShen(){
                axios.get("../../other/shen/getAllShen").then(res=>{
                    this.AllShen=res.data.data;
                    //console.log(res.data);
                })
            },
            Connection(){
                this.ws=new WebSocket("ws://localhost:5000/tui/"+this.userinfo.usid);
                this.ws.onopen=()=>{
                    console.log("服务器连接成功");
                    //开启心跳
                   // this.start();
                };
                this.ws.onclose=()=>{
                    console.log("服务器已断开");
                   // this.reconnect();
                };
                this.ws.onerror=()=>{
                   // this.reconnect();
                }
                this.ws.onmessage=(data)=>{
                    console.log(data)
                    this.getAllShen();

                   /* if(JSON.parse(data.data).system==false){
                      //  this.zu.push(JSON.parse(data.data))
                       // this.chat.content="";

                    }*/
                }
            },
            handleSuccess(response){
              //  this.article.pic=response.data.replace("\\\\","\\");
               this.tempArtInfo.pic=response.data;

            },
            handleError(){

            },
            //得到个人信息
            getUserinfo(userinfo){
                this.userinfo=userinfo;
                console.log(this.userinfo)
                this.backgroundImage=this.userinfo.background;
                console.log(this.backgroundImage)
               this.fileList.url=this.userinfo.photo;
                this.getAdmire();
                this.getMyBlog();
                this.getFav();
                this.getAllFans();
                this.getAllAttention();
                this.getPrivateBlog();
                this.getDraftArt();
                this.getWeiBlog();
                this.getAllShen();
            },
            //查看自己粉丝的详细信息
            getAllFans(){
                axios.get(`fired/getAllFans?usid=${this.userinfo.usid}&page=${this.fansPage.page}&size=${this.fansPage.size}`).then(res=>{
                   this.myFans=res.data.data;
                   this.fansPage.total=Number(res.data.message)
                })
            },
            //点击关注
            attention(usid){
               axios.get(`fired/guanzhu?usid=${this.userinfo.usid}&uid=${usid}`).then(res=>{
                   if(res.data.code==1){
                       this.$message.success(res.data.message);
                       this.getAllFans();
                   }else{
                       this.$message.error(res.data.message);
                   }
               })
            },
            //得到自己关注的博主
            getAllAttention(){
                axios.get(`fired/getAllAttention?usid=${this.userinfo.usid}&page=${this.attenPage.page}&size=${this.attenPage.size}`).then(res=>{
                    this.myAttention=res.data.data;
                    this.attenPage.total=res.data.message;
                })
            },
            //得到自己的blog有多少个赞
            getAdmire(){
                axios.get(`getAdmire?usid=${this.userinfo.usid}`).then(res=>{
                    this.guan.admire=res.data.data;
                })
            },
            //得到自己的私密blog
            getPrivateBlog(){
                axios(`getMyBlog?usid=${this.userinfo.usid}&page=${this.page.page}&size=${this.page.size}&status=${4}`).then(res=>{
                    this.privatePage.total=res.data.data.total;
                    this.privateBlog=res.data.data.records;
                })
            },
            //得到自己的存稿
            getDraftArt(){
                axios(`getMyBlog?usid=${this.userinfo.usid}&page=${this.page.page}&size=${this.page.size}&status=${-2}`).then(res=>{
                    /*this.privatePage.total=res.data.data.total;
                    this.privateBlog=res.data.data.records;*/
                    console.log(res.data);
                })
            },
            //修改信息
            uploadUserinfo(){
                this.userinfo.photo=this.fileList.url;
                axios.post("blog-user/userinfo/uploadUser",this.userinfo).then(res=>{
                    this.error={uname:'',pwd:'',repassword:'',email:'',phone:''};
                    if(res.data.code==1){
                        this.$message(res.data.message);

                    }else if(res.data.code==-1){
                        for (let dataKey in res.data.data) {
                            if(this.error[res.data.data[dataKey].field]==false) {
                                this.error[res.data.data[dataKey].field] = res.data.data[dataKey].defaultMessage + "<br>";
                            }
                        }
                    }
                })
            },
            //得到自己的blog
            getMyBlog(){
               axios(`getMyBlog?usid=${this.userinfo.usid}&page=${this.page.page}&size=${this.page.size}&status=${0}`).then(res=>{
                   this.article=res.data.data.records;
                   this.page.total=res.data.data.total
               })
            },
            //分页查询
            changePage(page){
                this.page.page=page;
                this.getMyBlog();
            },
            myFavChange(page){
                this.favPage.page=page;
                this.getFav();
            },
            //删除
            quding(aid,index){
              axios.get(`article/delMyBlog?aid=${aid}`).then(res=>{
                   if(res.data.code==1){
                       this.$message.success(res.data.message);
                       if(index==0){
                           this.getMyBlog();
                       }else if(index==4){
                           this.getPrivateBlog();
                       }
                   }else{
                       this.$message.error(res.data.message);
                   }

               })
            },
            //点击编辑
            bian(item){
                this.tempArtInfo=item;
                this.checkList=item.power.split(";");
                for (let i = 0; i < this.type.length; i++) {
                  if((this.type[i].tid)==item.tid){
                      this.tempArtInfo.tid=this.type[i].tname;
                  }
                }
                this.Visible=true;
                this.$nextTick(()=>{
                    let E = window.wangEditor
                    this.editor = new E('#edit')
                    // 或者 const editor = new E( document.getElementById('div1') )
                    this.editor.config.height = 800
                    this.editor.highlight=hljs;
                    this.editor.create();
                    this.editor.txt.html(item.content);
                })

            },
            //取消
            abolish(){
               this.getMyBlog();
               this.Visible=false;
            },
            //销毁文本编辑器
            closgDilog(){
                this.editor.destroy();
                this.editor=null;
                this.getMyBlog();
            },
            //得到里面的内容
            save(){
                this.tempArtInfo.content=this.editor.txt.html();
                this.tempArtInfo.showcol=this.editor.txt.text();
                this.getPower();
                for (let typeKey in this.type) {
                    if(this.type[typeKey].tname==this.tempArtInfo.tid){
                      this.tempArtInfo.tid=this.type[typeKey].tid;
                    }
                }
                axios.post("article/updateArticle",this.tempArtInfo).then(res=>{
                  if(res.data.code==1){
                      this.$message.success(res.data.message);
                      this.getMyBlog();
                      this.getPrivateBlog();
                      this.Visible=false;
                  }else if(res.data.code==-2){
                      this.$message.error(res.data.message);
                  }else if(res.data.code==-1){
                      this.$message.error(res.data.message);
                  }
                })
            },
            getPower(){
                let str=""
                if(this.checkList.length!=0){
                    for (let i = 0; i < this.checkList.length; i++) {
                        if(i==this.checkList.length-1){
                            str+=this.checkList[i];
                        }else{
                            str+=this.checkList[i]+";";
                        }
                    }
                    this.tempArtInfo.power=str;
                }else{
                    this.tempArtInfo.power="";
                }
            },
            //得到类别
            getAlltype(){
                axios.get("getAllType").then(res=>{
                    this.type=res.data;
                })
            },
            //得到自己的收藏
            getFav(){
                axios.get(`favorite/getFav?usid=${this.userinfo.usid}&page=${this.favPage.page}&size=${this.favPage.size}`).then(res=>{
                    this.myFav=res.data.data;
                    this.favPage.total=res.data.message;
                })
            },
            //取消收藏
            delCollection(usid,aid){
                axios.get(`favorite/delFav?usid=${usid}&aid=${aid}`).then(res=>{
                    if(res.data.code==1){
                        this.$message.success(res.data.message);
                        this.getFav();
                    }else{
                        this.$message.error(res.data.message);
                    }
                })
            },
            //查找未通过的blog
            getWeiBlog(){
                axios.get(`other/fail/getFailByUsid?usid=${this.userinfo.usid}&page=${this.weiBlogPage.page}&size=${this.weiBlogPage.size}`).then(res=>{
                    this.weiBlog=res.data.data;
                    console.log(res.data);
                })
            }
        },
        created(){
            this.getAlltype();
        },
        mounted() {

        },
    })
</script>
</body>
</html>